<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
    <base href="<%=basePath%>
    ">
    <%@ taglib uri="/struts-tags" prefix="s"%>
    <%@include file="./headMeta.jsp" %></head>
<body class="skin-blue">
    <%@include file="./header.jsp" %>
    <div class="wrapper row-offcanvas row-offcanvas-left">
        <!-- Left side column. contains the logo and sidebar -->
        <%@include file="./sidebar.jsp" %>

        <!-- Right side column. Contains the navbar and content of the page -->
        <aside class="right-side">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>订单</h1>
            </section>

            <!-- Main content -->
            <section class="content">
                <div class="row">
                    <div class="col-md-12">
                        <div class="box box-primary">
                            <div class="box-header">
                                <h3 class="box-title">订单列表</h3>
                                <div class="box-tool" style="margin: 7px 7px 0 0;">
                                    <ul class="pagination pagination-sm no-margin pull-right">
                                        <li>
                                            <a href="javascript:void(0)">&laquo;</a>
                                        </li>
                                        <li>
                                            <a href="javascript:void(0)">1</a>
                                        </li>
                                        <li>
                                            <a href="javascript:void(0)">2</a>
                                        </li>
                                        <li>
                                            <a href="javascript:void(0)">3</a>
                                        </li>
                                        <li>
                                            <a href="javascript:void(0)">&raquo;</a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            <!-- /.box-header -->
                            <div class="box-body no-padding">
                                <table class="table table-striped">
                                    <tr>
                                        <th style="width: 10%">订单号</th>
                                        <th style="width: 20%">日期</th>
                                        <th>总价</th>
                                        <th>折扣</th>
                                        <th>经手人</th>
                                        <th>有效</th>
                                        <th style="width:10%">查看明细</th>
                                        <th style="width:15%">退货操作</th>
                                    </tr>
                                    <s:iterator value="#listOrder" status="st">
                                        <tr>
                                            <td>${orderId }</td>
                                            <td>${addDate}</td>
                                            <td>${summ}</td>
                                            <td>${isVip=="true" ? "是" : "否"}</td>
                                            <td>${userList.get(st.index).getUsername() }</td>
                                             <s:set name="isValid" value="%{isValid }" />
                                            <td>${isValid=="true" ? "是" : "否"}</td>
                                            <td>
                                                <a href="order/listOrderItems.action?orderId=${orderId}">查看明细</a>
                                            </td>
                                            <td>
                                            <s:set name="isValid" value="%{isValid }" />
                                            <s:if test="#isValid==false">
                                                <a href="order/listReturns.action">查看退货记录</a>
                                                </s:if>
                                                <s:else>
                                            <a href="javascript:void(0)" class="dialog-open" data-oid="${orderId}" data-uid="${id }">退货</a>
                                            </s:else>
                                            </td>
                                        </tr>
                                    </s:iterator>
                                </table>
                            </div>
                            <!-- /.box-body --> </div>
                        <!-- /.box --> </div>
                    <!-- /.col --> </div>
                <!-- /.row --> </section>
            <!-- /.content --> </aside>
    </div>
    <!-- ./wrapper -->
</body>
    <%@include file="./javascript.jsp" %>
    <script type="text/javascript" src="./resource/js/return.js"></script>
</html>
